﻿#ifndef SEMIAUTOMEASUREDOCKWIDGET_H
#define SEMIAUTOMEASUREDOCKWIDGET_H

#include <QDockWidget>
#include "StageControlB140/StageControl.h"
#include "CameraImagingSource/TisCamera.h"
#include "MeasureData.h"
#include "SQLiteImplement2.h"
namespace Ui {
class SemiAutoMeasureDockWidget;
}

class SemiAutoMeasureDockWidget : public QDockWidget
{
    Q_OBJECT

public:
    explicit SemiAutoMeasureDockWidget(QWidget *parent = nullptr);
    ~SemiAutoMeasureDockWidget();
    void attachStageControl(StageControl * control);
    void attachData(MeasurementData *data);
    void attachCamera(TisCamera *camera);
private slots:
    void on_pushButtonLoadRecipe_clicked();
    void on_pushButtonStart_clicked();

    void on_pushButtonForward_clicked();

    void on_pushButtonBackward_clicked();

    void on_pushButtonGotoStart_clicked();

    void on_pushButtonGotoEnd_clicked();

private:
    void data2GUI();//将 m_data 中的全部数据更新到界面上
    void GUI2Data();// 将界面上的数据更新到 m_data 中
private:
    Ui::SemiAutoMeasureDockWidget *ui;
    StageControl * m_pStageControl = nullptr;
    MeasurementData *m_pData = nullptr;
    PersistenceInterface *m_pDatabase = nullptr;
    TisCamera *m_pCamera = nullptr;
    QString m_fileName;
};

#endif // SEMIAUTOMEASUREDOCKWIDGET_H
